//这个文件专门存放关于列表的接口
const Router = require("koa-router");//路由
const home = new Router();
const {  query} = require('../utils/db');
// 直接斜杠就是home的跟路径
home.get("/", async (ctx, next) => {
    let sql = 'select author from book';
    let res=undefined;
    query(sql,(isOk,data)=>{
        console.log(...data);
        res=data;
    })
    ctx.body ='a'
})
// 设置路由
home.get("/userInfo", async (ctx, next) => {
  ctx.body = '用户信息'
})
home.get("/userPrice", async (ctx, next) => {
  ctx.body = '用户余额'
})
module.exports = home